package top.leyi.ServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.leyi.IService.IVisitService;
import top.leyi.entity.Visit;
import top.leyi.mapper.VisitMapper;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class VisitServiceImpl implements IVisitService {
    @Autowired
    VisitMapper mapper;
    @Override
    public Map<Integer, Visit> getDateVisit(String date) {
        List<Visit> visits = mapper.queryVisitor(date);
        Map<Integer, Visit> result = new HashMap<>();
        for(Visit visit : visits) {
            result.put(visit.getHourTime(), visit);
        }
        return result;
    }
}
